<template>
    <div>
      <div v-if="layout!==-1" class="windowImgWrap">
        <div v-for="(item,index) in list" :key="index" :style="{width}">
            <img :src="item.imgUrl" >
        </div>
        <view>
        </view>
      </div>
      <div v-else class="specialWindWrap">
        <div class="left">
            <img :src="list[0].imgUrl" >
        </div>
        <div class="right">
            <div class="top">
                 <img :src="list[1].imgUrl" >
            </div>
            <div class="bottom">
                <div class="left">
                     <img :src="list[2].imgUrl" >
                </div>
                <div class="right">
                     <img :src="list[3].imgUrl" >
                </div>
            </div>
        </div>
      </div>
    </div>
</template>

<script>
    export default {
       inject: ['data','style','dataNum'],  
       data() {
        return {
            layout: this.style.layout,
            list:this.data
        };
   
       },
         mounted () {
     },
     computed: {
        width() {
            return (100/this.style.layout)+'%'
        }
     },
    }
</script>

<style lang="scss" scoped>
.windowImgWrap{
    display: flex;
    flex-wrap: wrap;
 div{
    height: 188rpx;
    img{
     width: 100%; 
     height: 100%;    
    }
 }
}

.specialWindWrap{
    display: flex;
    height: 375rpx;
    .left{
        width: 50%;
    }
    .right{
        width: 50%;
        .top{
            height: 50%;
        }
        .bottom{
            height: 50%;
            display: flex;
            .left,.right{
                width: 50%;
            }
        }
    }
    img{
        width: 100%;
        height: 100%;
    }
}
</style>